package com.feishi.core.analytic.element;

import com.feishi.core.analytic.PoType;
import com.feishi.core.analytic.parser.PoIntParser;
import com.feishi.core.analytic.parser.PoParser;

/**
 * Created by caixq on 5/12 012.
 */
public class AnalyticStaticContentLengthDataElement<T> extends AnalyticStaticInputDataElement<T> {
    public AnalyticStaticContentLengthDataElement(int length) {
        super(length);
    }

    public AnalyticStaticContentLengthDataElement(int type, int length) {
        super(type, length);
        if(length>1){
            this.parser= (PoParser<T>) new PoIntParser();
        }
    }

    public AnalyticStaticContentLengthDataElement(int type, int length, PoParser<T> parser) {
        super(type, length, parser);
    }

    public AnalyticStaticContentLengthDataElement(String name, int length) {
        super(name, length);
        this.type= PoType.ELEMENT_CONTENT_LENGTH;
        if(length>1){
            this.parser= (PoParser<T>) new PoIntParser();
        }
    }

    public AnalyticStaticContentLengthDataElement(String name, int length, PoParser<T> parser) {
        super(name, length, parser);
    }

    public AnalyticStaticContentLengthDataElement(String name, int type, int length, PoParser<T> parser) {
        super(name, type, length, parser);
    }


}
